package com.pucong.gitee.database.backup.common.selfenum;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("数据库驱动类")
public enum DatabaseDriverClassEnum implements CommonEnum<String> {

    oracle(0, "oracle.jdbc.driver.OracleDriver"),
    sqlserver(1, "com.microsoft.sqlserver.jdbc.SQLServerDriver"),
    mysql(2, "com.mysql.jdbc.Driver"),
    db2(3, "com.ibm.db2.jdbc.app.DB2Driver"),
    sybase(4, "com.sybase.jdbc.SybDriver"),
    informix(5, "com.informix.jdbc.IfxDriver"),
    postgresql(6, "org.postgresql.Driver"),
    hive(7, "org.postgresql.Driver");

    @ApiModelProperty(value = "key",example = "1")
    private Integer key;

    @ApiModelProperty("描述")
    private String className;

    DatabaseDriverClassEnum(Integer key, String className) {
        this.key = key;
        this.className = className;
    }

    /**
     * 字典code
     *
     * @return
     */
    @Override
    public Integer getValue() {
        return this.key;
    }

    public String getClassName() {
        return this.className;
    }

    /**
     * 字典名称
     *
     * @return
     */
    @Override
    public String getName() {
        return this.className;
    }
}